<ion-header>
    <ion-navbar color="primary">
        <ion-buttons start>
            <button ion-button style="font-size: 2.2rem;" (tap)="screen()">
          <ion-icon name="ios-paper-plane-outline"></ion-icon>
       </button>
        </ion-buttons>
        <ion-searchbar [(ngModel)]="myInput" placeholder="输入商品编号" [showCancelButton]="shouldShowCancel" (ionCancel)="onCancel($event)" (ionInput)="getItems($event)"></ion-searchbar>
        <ion-buttons end>
            <button ion-button style="font-size: 2.2rem;" (tap)="qrScanne()"> 
        <ion-icon name="ios-qr-scanner-outline"></ion-icon>
      </button> </ion-buttons>
    </ion-navbar>
</ion-header>

<ion-content>
    <ion-list>
        <div *ngIf="list">
            <ion-item class="itemList" style="height: 120px;" *ngFor="let item of list,let i = index" (click)="jumpDetail($event,i,item)">
                <ion-thumbnail item-start>
                    <img style="width: 80px;height: 80px;" [src]="item.imgSrc">
                </ion-thumbnail>
                <h2 text-center>{{item.title}}</h2>
                <h2 text-center>{{item.price}} <span>(x {{item.num}})</span> </h2>
                <div class="shopCarBox">
                    <ion-icon *ngIf="!item.visibleBtn" class="car" name="ios-cart" tappable (click)="bofang($event,item)"></ion-icon>
                    <ion-buttons end *ngIf="item.visibleBtn">
                        <div color="danger" (click)="doDelete($event,i)" class="dodelete">
                            购买
                        </div>
                    </ion-buttons>
                </div>
                <div class="number" (click)="stop($event)">
                    <strong>数量:</strong>
                    <div class="cart_number">
                        <div class="input_left" (click)="incNum(item, -1)">-</div>
                        <div class="input_center">
                            <input type="text" readonly="readonly" [(ngModel)]='item.num' name="num" id="num" />
                        </div>
                        <div class="input_right" (click)="incNum(item, 1)">+</div>
                    </div>
                </div>
            </ion-item>
        </div>

    </ion-list>
    <audio #audio src="../../assets/audio/4204.mp3"></audio>
</ion-content>